﻿using System;

namespace TrinityEngine
{
    public abstract class YieldInstruction
    {
        public abstract bool DealWithYield();
    }

    public class WaitForSeconds : YieldInstruction
    {
        private float _waitTime;
        private DateTime _beginTime;

        public WaitForSeconds(float second)
        {
            _waitTime = second;
            _beginTime = DateTime.Now;
        }

        public override bool DealWithYield()
        {
            return (DateTime.Now - _beginTime).TotalSeconds >= _waitTime;
        }
    }
}
